#include <iostream>
#include <iterator>
#include <deque>
using namespace std;

template <typename T>
void display(T t){
    for(auto & a:t){
        cout << a << ' ';
    }
    cout<< endl;
}

void test(){
    deque<int> temp1={1,2,3,4,5,6};
    deque<int>::iterator it = temp1.begin();
    ++it;
    ++it;
    display(temp1);
    cout << "*it = " << *it << endl;
    //插入value
    temp1.insert(it,10);
    display(temp1);
    cout << "*it = " << *it << endl;
    //插入count个value
    temp1.insert(it,3,100);
    display(temp1);
    cout << "*it = " << *it << endl;
    //通过迭代器插入
    deque<int> temp2={33,55,66};
    temp1.insert(it,temp2.begin(),temp2.end());
    display(temp1);
    cout << "*it = " << *it << endl;
    //通过{}插入
    temp1.insert(it,{999,999,999,999});
    display(temp1);
    cout << "*it = " << *it << endl;
}

int main()
{
    test ();
    return 0;
}

